package com.bwstudio.demo.auth.controller;

import org.apache.commons.io.IOUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.net.URI;
import java.nio.charset.StandardCharsets;

/**
 * @author buwei
 */
@RestController
public class GitInfoController {

    @GetMapping("/git_info")
    public String getGitInfo() throws Exception{
        // 直接将 git 信息文件的内容返回给客户端
        return IOUtils.toString(new URI("classpath:git.properties"), StandardCharsets.UTF_8.toString());
    }
}
